package com.keyingbo.leran.pattern.singletonpattern.lazy;

/**
 * @Auther: KEYB
 * @Date: 2019-3-11 23:27
 * @Description:
 */
public class LazySingleton {
    private static LazySingleton lazySingleton = null;
    private LazySingleton(){}
    public static LazySingleton getInstance(){
        if (lazySingleton == null){
            synchronized (LazySingleton.class){
                if (lazySingleton == null) {
                    lazySingleton = new LazySingleton();
                }
            }
        }
        return lazySingleton;
    }
}
